package org.xiaojun.axiosTest.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xj
 * @create 2021/8/21 16:50
 */
@Controller
public class AxiosTest {

    @RequestMapping("/axiosTest")
    public String page(){
        return "axiosTest";
    }


    @RequestMapping("/test01")
    @ResponseBody
    public String test01(String name, Integer age){

        System.out.println("name = " + name);
        System.out.println("age = " + age);
        if (2 > 1) {
            throw new RuntimeException("密码错误");
        }
        return "success";

    }
}
